<%--
  Created by IntelliJ IDEA.
  User: 贝爷
  Date: 2019/7/23
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title><script language="javascript">

    function OpenP()
    {
        var xml = document.getElementById("Text1").value;
        var re = document.getElementById("CHeNanCPUCtrl").HdOpenPort(xml);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function PsamP()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdPowerOn(0x11);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }

    function SSCP()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdPowerOn(0x01);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function Read05()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdReaderEF05();
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function Read06()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdReaderEF06();
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function Write05()
    {
        //var xml = "210300D1560000050004185301020306|2|2.00|A404000F00A404000F00A403|20170801|20160311|123456789|";
        var xml = document.getElementById("Text3").value;
        var re = document.getElementById("CHeNanCPUCtrl").HdWriteEF05(xml);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }

    function Write06()
    {
        //var xml = "41010219920722004X|刘亚飞||1|02|123455|20170801|";
        var xml = document.getElementById("Text3").value;
        var re = document.getElementById("CHeNanCPUCtrl").HdWriteEF06(xml);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function PsamOff()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdPowerOff(0x11);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }

    function SSCOff()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdPowerOff(0x01);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function CloseP()
    {
        var re = document.getElementById("CHeNanCPUCtrl").HdClosePort();
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }
    function ReadSFZ()
    {
        var xml = document.getElementById("Text3").value;
        var re = document.getElementById("CHeNanCPUCtrl").HdReadSFZ(xml);
        var str1 =document.getElementById("CHeNanCPUCtrl").OutInfo;
        document.form1.cardinfo.value=str1;
    }

</script>


</head>
<center>
    <h2>社保卡B/S测试</h2>
    <hr width="100%" size="1" noshade color="#ff0000">

</center>
<body>
<OBJECT classid=clsid:E1B74B7F-3C3E-4754-8A80-D5B8E7E158CD width=100 height=100 align="center"  id="CHeNanCPUCtrl" HSPACE=0 VSPACE=0>
</OBJECT>


<form name="form1">

    <p>信息输出：<input id="Text2"  type="text"  name="cardinfo" size="60">
    <p>通用设备："USB1" 072F 90D5
    <p>更改设备："USB4" 0732 90D8
    <p>设备选择：<input id="Text1"  type="text"  size="5" Value="USB1">

    <p><input type="button" onclick="javascript:OpenP()" value= " 打开端口 " >

        <input type="button" onclick="javascript:PsamP()" value="psam卡上电" >

        <input type="button" onclick="javascript:SSCP()" value="社保卡上电" >

    <p><input type="button" onclick="javascript:Read05()" value="读EF05信息" >

        <input type="button" onclick="javascript:Read06()" value="读EF06信息" >

    <p>信息输入：<input id="Text3"  type="text"   size="60">

    <p><input type="button" onclick="javascript:ReadSFZ()" value="读身份证信息" >

    <p><input type="button" onclick="javascript:Write05()" value="写EF05信息" >

        <input type="button" onclick="javascript:Write06()" value="写EF06信息" >

    <p><input type="button" onclick="javascript:PsamOff()" value="PSAM卡下电" >

        <input type="button" onclick="javascript:SSCOff()" value="社保卡下电" >

        <input type="button" onclick="javascript:CloseP()" value="关闭设备" >
</form>

</body>
</html>
